﻿using AutoMapper;
using System.Linq;
using Windows.Assistance.Domain;
using Windows.Infrastructure.Share.Extensions;
using Windows.SeedWord;

namespace Windows.Assistance.Application
{
    public class DomainToDtoMappingProfile : Profile
    {
        /// <summary>
        /// 配置构造函数，用来创建关系映射
        /// </summary>
        public DomainToDtoMappingProfile()
        {
            CreateMap<LogOperate, LogOperateResponse>();
            CreateMap<Dictionary, DictionaryResponse>();
            CreateMap<DictionaryCategory, DictionaryCategoryResponse>().ForMember(
               dto => dto.Dictionaries,
               domain => domain.MapFrom(src => src.Dictionaries)
            ); ;
        }
    }
}
